<#import "../dump.ftl" as dumperutil>

<#if RequestParameters?has_content>
	<#if RequestParameters.output?has_content || RequestParameters.o?has_content>
		<#if RequestParameters.output?has_content>
			<#assign dObj = "${RequestParameters.output}">
		</#if>
		<#if RequestParameters.o?has_content>
			<#assign dObj = "${RequestParameters.o}">
		</#if>		
	</#if>
	<#if RequestParameters.debug?has_content || RequestParameters.d?has_content >
		<#if RequestParameters.d?has_content>
			<#assign debug = "${RequestParameters.d}">
		</#if>
		<#if RequestParameters.debug?has_content>
			<#assign debug = "${RequestParameters.debug}">
		</#if>			
	</#if>
</#if>

<#macro pdumper data dumpName="" showBG=false>
	<div style="display:block;position:relative;float:left;top:0;left:0;width:75%;height:100%;z-index:1000;clear:both;<#if showBG>background:#666666;</#if>">
		<pre style="display:block;width:100%;height:100%;">
			<h1 style="font-size:2em;">${dumpName?upper_case}</h1>
			<@dumperutil.dump data/>
		</pre>
	</div>
</#macro>

<#macro dumper data dumpName="" show=true showBG=false>
	<#if (debug?has_content && debug == "true") || show>
		<#if dObj??>
			<@pdumper dObj?eval "requested dump - ${dObj}" showBG/>
		<#else>
			<@pdumper data dumpName showBG/>
		</#if>
	</#if>
</#macro>
